<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <head>
        <title>TODO supply a title</title>
    </head>
    <h:body>
        <ui:composition template="/resources/template/myTemplate.xhtml">
            <ui:define name="content">             
                <c:set var="registered" scope="view" value="#{userManagedBean.registered}"/>
                <c:if test="${registered}">   
                    <h:form>
                        <h3>User info</h3>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Name : "/>
                            <h:outputText value="#{userManagedBean.user.name}"/>

                            <h:outputLabel value="Surname : "/>
                            <h:outputText value="#{userManagedBean.user.surName}"/>

                            <h:outputLabel value="Email : "/>
                            <h:outputText value="#{userManagedBean.user.email}"/>

                            <h:outputLabel value="Password : "/>
                            <h:outputText value="#{userManagedBean.user.password}" />

                            <h:outputLabel value="Adress : "/>
                            <h:outputText value="#{userManagedBean.user.adress}"/>

                            <h:outputLabel value="Telephone : "/>
                            <h:outputText value="#{userManagedBean.user.telephone}"/>
                            
                            <p:commandButton value="Update" action="update"/>
                        </h:panelGrid>
                        
                        
                    </h:form>
                </c:if>
                <c:if test="${!registered}">
                    Dear costumer you don`t have acces to this part of service. Please log-in or register.
                </c:if>
            </ui:define>
        </ui:composition>
    </h:body>
</html>